package com.bluefox.servlet.config;

import com.bluefox.servlet.MyServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author : 清风冷影
 * @Description:
 * @Date : 2022/1/14  10:17
 */
@Configuration
public class ServletConfig {
    /**
     * 方法一：通过ServletRegistrationBean注册
     * @return
     */
    @Bean
    public ServletRegistrationBean servletRegistrationBean(){
        return new ServletRegistrationBean(new MyServlet(),"/myServlet/*") ;
    }

}
